{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>FTR51_max_group=A0B0C0E0D0</th>\n",
       "      <th>FTR51_max_group=A0B0C0E0D0,A0B0C10E23D12</th>\n",
       "      <th>FTR51_max_group=A0B0C0E0D0,A0B0C10E5D3</th>\n",
       "      <th>FTR51_max_group=A0B0C0E0D0,A0B0C2759E5D3</th>\n",
       "      <th>FTR51_max_group=A0B0C0E0D0,A0B0C2E0D1</th>\n",
       "      <th>FTR51_max_group=A0B0C0E0D0,A0B0C2E129D1</th>\n",
       "      <th>FTR51_max_group=A0B0C0E0D0,A0B0C2E16D1</th>\n",
       "      <th>FTR51_max_group=A0B0C0E0D0,A0B0C2E1D1</th>\n",
       "      <th>FTR51_max_group=A0B0C0E0D0,A0B0C2E2D1</th>\n",
       "      <th>...</th>\n",
       "      <th>FTR49_std</th>\n",
       "      <th>FTR50_mean</th>\n",
       "      <th>FTR50_sum</th>\n",
       "      <th>FTR50_std</th>\n",
       "      <th>APPLYNO_count</th>\n",
       "      <th>FTR51_nunique</th>\n",
       "      <th>FTR51_max_med</th>\n",
       "      <th>FTR51_total_med</th>\n",
       "      <th>FTR51_type_med</th>\n",
       "      <th>LABEL_unique</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>PERSONID</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>000e3ee6e04a8b18871e1c85ffab6e49</th>\n",
       "      <td>0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>81</td>\n",
       "      <td>42</td>\n",
       "      <td>0</td>\n",
       "      <td>3625</td>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>000eba50dc8c2e3899070c6b82986814</th>\n",
       "      <td>1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>84</td>\n",
       "      <td>48</td>\n",
       "      <td>0</td>\n",
       "      <td>4795</td>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>00139506cbd54b670e1e6dec234190e1</th>\n",
       "      <td>2</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>39</td>\n",
       "      <td>21</td>\n",
       "      <td>0</td>\n",
       "      <td>2763</td>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0014fdb3625079de4a0d2131fd860641</th>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>153</td>\n",
       "      <td>51</td>\n",
       "      <td>0</td>\n",
       "      <td>6527</td>\n",
       "      <td>16</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>001de94e8d0d152e26ad87cb409003f9</th>\n",
       "      <td>4</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000138</td>\n",
       "      <td>0.008026</td>\n",
       "      <td>0.000306</td>\n",
       "      <td>58</td>\n",
       "      <td>31</td>\n",
       "      <td>0</td>\n",
       "      <td>2582</td>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 945 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                  Unnamed: 0  FTR51_max_group=A0B0C0E0D0  \\\n",
       "PERSONID                                                                   \n",
       "000e3ee6e04a8b18871e1c85ffab6e49           0                         0.0   \n",
       "000eba50dc8c2e3899070c6b82986814           1                         0.0   \n",
       "00139506cbd54b670e1e6dec234190e1           2                         0.0   \n",
       "0014fdb3625079de4a0d2131fd860641           3                         1.0   \n",
       "001de94e8d0d152e26ad87cb409003f9           4                         0.0   \n",
       "\n",
       "                                  FTR51_max_group=A0B0C0E0D0,A0B0C10E23D12  \\\n",
       "PERSONID                                                                     \n",
       "000e3ee6e04a8b18871e1c85ffab6e49                                       0.0   \n",
       "000eba50dc8c2e3899070c6b82986814                                       0.0   \n",
       "00139506cbd54b670e1e6dec234190e1                                       0.0   \n",
       "0014fdb3625079de4a0d2131fd860641                                       0.0   \n",
       "001de94e8d0d152e26ad87cb409003f9                                       0.0   \n",
       "\n",
       "                                  FTR51_max_group=A0B0C0E0D0,A0B0C10E5D3  \\\n",
       "PERSONID                                                                   \n",
       "000e3ee6e04a8b18871e1c85ffab6e49                                     0.0   \n",
       "000eba50dc8c2e3899070c6b82986814                                     0.0   \n",
       "00139506cbd54b670e1e6dec234190e1                                     0.0   \n",
       "0014fdb3625079de4a0d2131fd860641                                     0.0   \n",
       "001de94e8d0d152e26ad87cb409003f9                                     0.0   \n",
       "\n",
       "                                  FTR51_max_group=A0B0C0E0D0,A0B0C2759E5D3  \\\n",
       "PERSONID                                                                     \n",
       "000e3ee6e04a8b18871e1c85ffab6e49                                       0.0   \n",
       "000eba50dc8c2e3899070c6b82986814                                       0.0   \n",
       "00139506cbd54b670e1e6dec234190e1                                       0.0   \n",
       "0014fdb3625079de4a0d2131fd860641                                       0.0   \n",
       "001de94e8d0d152e26ad87cb409003f9                                       0.0   \n",
       "\n",
       "                                  FTR51_max_group=A0B0C0E0D0,A0B0C2E0D1  \\\n",
       "PERSONID                                                                  \n",
       "000e3ee6e04a8b18871e1c85ffab6e49                                    0.0   \n",
       "000eba50dc8c2e3899070c6b82986814                                    0.0   \n",
       "00139506cbd54b670e1e6dec234190e1                                    0.0   \n",
       "0014fdb3625079de4a0d2131fd860641                                    0.0   \n",
       "001de94e8d0d152e26ad87cb409003f9                                    0.0   \n",
       "\n",
       "                                  FTR51_max_group=A0B0C0E0D0,A0B0C2E129D1  \\\n",
       "PERSONID                                                                    \n",
       "000e3ee6e04a8b18871e1c85ffab6e49                                      0.0   \n",
       "000eba50dc8c2e3899070c6b82986814                                      0.0   \n",
       "00139506cbd54b670e1e6dec234190e1                                      0.0   \n",
       "0014fdb3625079de4a0d2131fd860641                                      0.0   \n",
       "001de94e8d0d152e26ad87cb409003f9                                      0.0   \n",
       "\n",
       "                                  FTR51_max_group=A0B0C0E0D0,A0B0C2E16D1  \\\n",
       "PERSONID                                                                   \n",
       "000e3ee6e04a8b18871e1c85ffab6e49                                     0.0   \n",
       "000eba50dc8c2e3899070c6b82986814                                     0.0   \n",
       "00139506cbd54b670e1e6dec234190e1                                     0.0   \n",
       "0014fdb3625079de4a0d2131fd860641                                     0.0   \n",
       "001de94e8d0d152e26ad87cb409003f9                                     0.0   \n",
       "\n",
       "                                  FTR51_max_group=A0B0C0E0D0,A0B0C2E1D1  \\\n",
       "PERSONID                                                                  \n",
       "000e3ee6e04a8b18871e1c85ffab6e49                                    0.0   \n",
       "000eba50dc8c2e3899070c6b82986814                                    0.0   \n",
       "00139506cbd54b670e1e6dec234190e1                                    0.0   \n",
       "0014fdb3625079de4a0d2131fd860641                                    0.0   \n",
       "001de94e8d0d152e26ad87cb409003f9                                    0.0   \n",
       "\n",
       "                                  FTR51_max_group=A0B0C0E0D0,A0B0C2E2D1  \\\n",
       "PERSONID                                                                  \n",
       "000e3ee6e04a8b18871e1c85ffab6e49                                    0.0   \n",
       "000eba50dc8c2e3899070c6b82986814                                    0.0   \n",
       "00139506cbd54b670e1e6dec234190e1                                    0.0   \n",
       "0014fdb3625079de4a0d2131fd860641                                    0.0   \n",
       "001de94e8d0d152e26ad87cb409003f9                                    0.0   \n",
       "\n",
       "                                      ...       FTR49_std  FTR50_mean  \\\n",
       "PERSONID                              ...                               \n",
       "000e3ee6e04a8b18871e1c85ffab6e49      ...             0.0    0.000000   \n",
       "000eba50dc8c2e3899070c6b82986814      ...             0.0    0.000000   \n",
       "00139506cbd54b670e1e6dec234190e1      ...             0.0    0.000000   \n",
       "0014fdb3625079de4a0d2131fd860641      ...             0.0    0.000000   \n",
       "001de94e8d0d152e26ad87cb409003f9      ...             0.0    0.000138   \n",
       "\n",
       "                                  FTR50_sum  FTR50_std  APPLYNO_count  \\\n",
       "PERSONID                                                                \n",
       "000e3ee6e04a8b18871e1c85ffab6e49   0.000000   0.000000             81   \n",
       "000eba50dc8c2e3899070c6b82986814   0.000000   0.000000             84   \n",
       "00139506cbd54b670e1e6dec234190e1   0.000000   0.000000             39   \n",
       "0014fdb3625079de4a0d2131fd860641   0.000000   0.000000            153   \n",
       "001de94e8d0d152e26ad87cb409003f9   0.008026   0.000306             58   \n",
       "\n",
       "                                  FTR51_nunique  FTR51_max_med  \\\n",
       "PERSONID                                                         \n",
       "000e3ee6e04a8b18871e1c85ffab6e49             42              0   \n",
       "000eba50dc8c2e3899070c6b82986814             48              0   \n",
       "00139506cbd54b670e1e6dec234190e1             21              0   \n",
       "0014fdb3625079de4a0d2131fd860641             51              0   \n",
       "001de94e8d0d152e26ad87cb409003f9             31              0   \n",
       "\n",
       "                                  FTR51_total_med  FTR51_type_med  \\\n",
       "PERSONID                                                            \n",
       "000e3ee6e04a8b18871e1c85ffab6e49             3625              16   \n",
       "000eba50dc8c2e3899070c6b82986814             4795              16   \n",
       "00139506cbd54b670e1e6dec234190e1             2763              16   \n",
       "0014fdb3625079de4a0d2131fd860641             6527              16   \n",
       "001de94e8d0d152e26ad87cb409003f9             2582              16   \n",
       "\n",
       "                                  LABEL_unique  \n",
       "PERSONID                                        \n",
       "000e3ee6e04a8b18871e1c85ffab6e49             0  \n",
       "000eba50dc8c2e3899070c6b82986814             0  \n",
       "00139506cbd54b670e1e6dec234190e1             0  \n",
       "0014fdb3625079de4a0d2131fd860641             2  \n",
       "001de94e8d0d152e26ad87cb409003f9             0  \n",
       "\n",
       "[5 rows x 945 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "df_derive = pd.read_csv('data/train_derive.csv', index_col= 'PERSONID')\n",
    "df_selection = df_derive\n",
    "df_selection.head()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_selection.to_csv('data/train_selection.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
